package com.dm.cloud.images.mode;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;

/**
 * 应用容器信息
 */
@NoArgsConstructor
@AllArgsConstructor
@Schema(description ="应用编排模型")
@Data
public class AppContainerModel {

    @Schema(description = "应用code")
    private String code;

    @Schema(description = "应用操作状态:0无操作  1正在启动  2正在关闭 3正在重启")
    private Integer appOptionStatus;

    @Schema(description = "容器情况")
    List<List<ContainerModel>> containers=new ArrayList<>();
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description ="应用编排模型")
    @Data
    public static class ContainerModel{

        @Schema(description = "容器ID")
        private String id;

        /** 容器ID **/
        @Schema(description = "容器ID")
        private String containerId;

        /** 节点ID **/
        @Schema(description = "节点ID")
        private String nodeId;

        @Schema(description = "容器名称")
        private List<String> names;

        @Schema(description = "容器操作执行状态:0未执行  1正在执行 2执行完成")
        private Integer operateStatus;

        @Schema(description = "容器执行结果:0暂无结果(未完成情况) 1成功  2异常  3超时")
        private Integer containerResult;

        @Schema(description = "容器运行状态")
        private String runningState;

        @Schema(description = "异常信息")
        private String errStr;

    }

}
